package extensions.android;

import uclm.extensions.android.R;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;

public class LauncherActivity extends ListActivity
{
	private Class<?>[] _activities = new Class[]{ClientActivity.class, InputActivity.class, AutoParallaxBackgroundExample.class, MenuExample.class, RomarioMenu.class, RomarioGameActivity.class};
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		String[] strs = new String[_activities.length];
		
		for (int i=0; i<_activities.length; i++)
			strs[i] = _activities[i].getSimpleName();

		setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, strs));
		getListView().setOnItemClickListener(new OnItemClickListener() {
		    public void onItemClick(AdapterView<?> parent, View view, int position, long id)
		    {
		        Class<?> activity = _activities[position];
		  		startActivity(new Intent(LauncherActivity.this, activity));
		    }
		});
	}

}
